package com.atguigu.lease.web.admin.mapper;

import com.atguigu.lease.model.entity.LeaseTerm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author liubo
* @description 针对表【lease_term(租期)】的数据库操作Mapper
* @createDate 2023-07-24 15:48:00
* @Entity com.atguigu.lease.model.LeaseTerm
*/
public interface LeaseTermMapper extends BaseMapper<LeaseTerm> {

    /**
     * 根据房间id获取租期列表
     * @param id
     * @return
     */
    @Select("select * from lease_term where is_deleted = 0 and id in " +
            "(select lease_term_id from room_lease_term where is_deleted = 0 and room_id = #{id})")
    List<LeaseTerm> selectListByRoomId(Long id);
}




